<!--输入框-->
<template>
	<el-input v-model="value" v-bind="allAttrs" :id="'zhinput' + columnId" :name="'zhinput' + columnId" :size="mySize" :clearable="clearable"> 
    <template #[item]="data" v-for="item in Object.keys($slots)">
			<slot :name="item" v-bind="data || {}"></slot>
		</template>
  </el-input>
</template>

<script lang="ts" setup name="zh-input">
// 引入组件需要的属性、控制类
import { itemProps, itemController } from '../lib/mapController';
// 定义属性
const props = defineProps({
	modelValue: [String, Number],
	...itemProps, // 基础属性
});
const attrs = useAttrs();
const emit = defineEmits(['update:modelValue']);
const allAttrs = computed(() => {
	return Object.assign(props.extend, attrs);
});
const { value, globalSize } = itemController(props, allAttrs.value, emit);
const state = reactive({
	mySize: allAttrs.value.size,
});
// 初始化
globalSize(state);
// 输出
const { mySize } = toRefs(state);
</script>

